$(document).ready(function() {

    // GET WIDTH WINDOW
    var w_Window = $(window).width();

    // RESIZE IMG
    $(".img-liquid").imgLiquid();

    // OWL CAROUSEL
    var owl_1 = $("#owl-carousel-01");
    owl_1.owlCarousel({
        itemsCustom: [
            [0, 1],
            [450, 2],
            [600, 2],
            [700, 2],
            [900, 3],
            [1200, 4],
            [1400, 4],
            [1600, 4]
        ],
        navigation: true,
        pagination: false,
        autoPlay: true,
        stopOnHover: true
    });

    var owl_2 = $("#owl-carousel-02");
    owl_2.owlCarousel({
        itemsCustom: [
            [0, 1],
            [450, 2],
            [600, 3],
            [700, 4],
            [900, 5],
            [1200, 6],
            [1400, 6],
            [1600, 6]
        ],
        navigation: true,
        pagination: false,
        autoPlay: 8000,
        stopOnHover: true
    });

    // MAGNAFIC POPUP
    $("#btn-booking").magnificPopup({
        type: 'inline',
        removalDelay: 500, //delay removal by X to allow out-animation
        callbacks: {
            beforeOpen: function() {
                this.st.mainClass = this.st.el.attr('data-effect');
            },
			close: function() {
			  $(".form-control").attr("class", "form-control");
			  $(".form-control").val("");
			}
        },
        midClick: true
    });
	
	// MAGNAFIC POPUP 1 bổ sung
    $("#btn-booking1").magnificPopup({
        type: 'inline',
        removalDelay: 500, //delay removal by X to allow out-animation
        callbacks: {
            beforeOpen: function() {
                this.st.mainClass = this.st.el.attr('data-effect');
            },
			close: function() {
			  $(".form-control").attr("class", "form-control");
			  $(".form-control").val("");
			}
        },
        midClick: true
    });

    // BLACK & WHITE
    $('.bwWrapper').BlackAndWhite({
        hoverEffect: true,
        webworkerPath: false,
        invertHoverEffect: true,
        responsive: true,
        speed: {
            fadeIn: 500,
            fadeOut: 500
        },
    });

    // MENU RESPONSIVE
    $('#wd-menu-vertical').mmenu();

    // STYLE SELECT BOX
    $('.select').each(function() {
        var selectTag = $(this).find('select'),
            textSelected = $(this).find('.text-selected'),
            defaulttext = $(this).find('select option:first-child').text();
        textSelected.text(defaulttext);
        selectTag.on('change', function() {
            var defaulttext2 = selectTag.find(":selected").text();
            textSelected.text(defaulttext2);
        });
    });
});